import requests


class TokenIhrm:
    @classmethod
    def token_login(cls):
        url = "http://ihrm2-test.itheima.net/api/sys/login"
        header = {"Content-Type": "application/json"}
        body = {"mobile": "13800000002", "password": "123456"}
        reps = requests.post(url=url, headers=header, json=body)
        # print(reps.json())

        token = reps.json().get("data")
        return token


if __name__ == '__main__':
    token = TokenIhrm.token_login()
    print(token)
